1. Field
Embodiments of the invention relate to the field of networking; and more specifically, to the distributing packets among servers in networking.
2. Background Information
There are numerous examples in networking where clients or service requesters communicate with servers or providers of services or resources over one or more networks. The clients typically request a resource or that a service be performed and the servers perform the service or provide the resource. Often a set of servers are provided in order to provide greater servicing capability, resiliency or high availability (e.g., in the event of a server failing or being taken offline), etc. As an example, a server farm may be used to provide services associated with web sites, Internet Relay Chat networks, high-bandwidth File Transfer Protocol sites, Network News Transfer Protocol (NNTP) servers, Domain Name System (DNS) servers, to name just a few examples.
Server load balancing is commonly used to distribute service requests from the clients among a set of servers in order to balance or more evenly distribute loads (e.g., processing loads or workloads) associated with handling the service requests among the set of servers. Server load balancing, within certain constraints, generally helps to prevent some of the servers from being over loaded while other servers are being underutilized. Such server load balancing generally offers advantages such as increased resource utilization, increased performance, increased throughput, reduced response time, reduced server overload, etc. In addition, server load balancing may also be used in conjunction with providing resiliency or high availability by redistributing loads when one of the servers fails, is taken offline, etc. Generally the server load balancing is transparent to the clients requesting the services.
Server load balancing algorithms are commonly used to determine which servers to distribute service requests or workloads to. The server load balancing algorithms commonly include scheduling algorithms as well as other algorithms. The algorithms used to implement server load balancing vary from relatively simple algorithms to relatively sophisticated algorithms. Examples of relatively simple algorithms include random choice algorithms and round robin algorithms. Examples of more sophisticated algorithms include those that take into account factors pertinent to load balancing such as the server's current load, a server's up/down status, etc. By way of example, a weighted round robin algorithm may be used and the weights for the servers may be changed dynamically based on the current workloads of the servers.
A common type of server load balancing is known as stateful server load balancing. In one known approach for stateful server load balancing, a first packet of a flow is detected at a server load balancer. For example, a SYN packet of a TCP connection may be detected by examining a header of the SYN packet. The server load balancer uses a server load balancing algorithm (e.g., a random choice algorithm or a round robin algorithm) to select or assign a server to handle the TCP connection. An entry including an identifier for the TCP connection and an identifier for the server assigned to handle the TCP connection is added as state to a state table maintained by the server load balancer. Subsequently, when additional packets of the TCP connection are received, the server load balancer performs a table lookup into the state table. The table lookup locates the entry that maps the TCP connection identifier to the server identifier. The server load balancer forwards the additional packets to the identified server. In such a stateful approach, state that is based on a previous load balancing decision (e.g., based on a previous calculation with a load balancing algorithm) is stored or preserved and is used to make subsequent load balancing decisions.
Such stateful server load balancing approaches tend to have certain drawbacks especially when the number of connections is high. As one example, when the number of connections is high, the size of the state table tends to become correspondingly large. As a result, the amount of memory to store the table generally increases. Also, the time and processing resources needed to perform table lookups generally also increase. Such table lookups may be performed for each packet received for each established connection. Moreover, the load balancing algorithm may be performed for each new connection. Consequently, especially when the number of connections is high, such approaches may potentially cause the sever load balancer to suffer from resource exhaustion from memory and/or processing resources. Alternatively, in an effort to avoid such resource exhaustion, the load balancers may be highly provisioned with hardware, which generally tends to make them correspondingly costly. Another potential drawback, if a redundant or backup server load balancer is provided (e.g., for resiliency or high availability), is that significant communication and processing overhead may be encountered in order to synchronize the state (e.g., state table) of the redundant or backup server load balancer.